// import the fs module 
const fs = require('fs');

// the reader to read the target file contents
fs.readFile('../resources/JavaTools.txt',
            'utf8',
            (err, data) => {
                // read error 
                if(err) return console.log("reading file goes fail: " + err.message);

                // read successfully

                // 1. split the raw file contents
                const arrOld = data.split(' ');

                // 2. processes the each item in the old array.
                const arrNew = [];
                arrOld.forEach(item => {
                    arrNew.push(item.replace('=', ':'));
                });

                // 3. combine the each item together
                const formatTb = arrNew.join('\r\n');

                // 4. test the procedure
                console.log(formatTb);
            });

